package com.kma.summer2012.client.events.manager;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.kma.summer2012.shared.model.UICrumbsToolItem;

public class EditToolEvent extends GwtEvent<EditToolEvent.EditToolEventHandler> {
    private static Type<EditToolEventHandler> TYPE = new Type<EditToolEventHandler>();
    private final UICrumbsToolItem uiTool;

    public EditToolEvent(UICrumbsToolItem uiTool) {
        this.uiTool = uiTool;
    }

    public UICrumbsToolItem getUiTool() {
        return uiTool;

    }

    @Override
    public Type<EditToolEventHandler> getAssociatedType() {
        return TYPE;
    }

    public static Type<EditToolEventHandler> getType() {
        return TYPE;
    }

    @Override
    protected void dispatch(EditToolEventHandler editToolEventHandler) {
        editToolEventHandler.onEditTool(this);
    }


    public interface EditToolEventHandler extends EventHandler {
        void onEditTool(EditToolEvent event);
    }
}

